home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
internet
/
irc_i_dodatki
/
kuang
/
kuangeleven28.lha
/
Rexx
/
CTCP
/
fdcc.amirx
< prev
next >
Wrap
Text File
|
1997-01-21
|
5KB
|
150 lines
/*) CTCP FDCC v1.1 by Josef Faulkner (panther@gate.net) IRC: Josef
\\\
/\/ Written for Grapevine 1.436 and newer. (CTCP trapping)
\\\
CONVERTED TO AMIRC by Ariel Magnum for Kuang Eleven 2.5
-Arexx commands and parsing converted to AmIRC
-HELP string fixed
/\/ This program is unlike XDCC in that it will allow a user to access
\\\ a directory, and all of its subdirectories recursively to autoget
/\/ by DCC files from you.
\\\
/\/ I have tried to make the system as secure as possible, so that nobody
\\\ can go above the assigned area on your drive. If you see any holes in
/\/ this, please inform me asap.
\\\
/\/ Insallation:
\\\ 1) install in your amirc rexx drawer
/\/ 2) assign FDCC: wherever your files are
\\\
/\/ Usage:
\\\ /ctcp <nick> LIST lists files in format <name> <size> <filenote>
/\/ /ctcp <nick> SEND <file> sends <file> in current dir
\\\ /ctcp <nick> MOVE <file> sends <file> in current dir by DCC MOVE
/\/ /ctcp <nick> CD <dir> changes directory to <dir> for that user
\\\
/\/ Notes:
\\\ o Up to 40-character descriptions can be added by simply making a filenote
/\/ o No recursion limits
\\\ o Separate current directories kept in arexx clipboards for each nick
/\/ o DO NOT USE ANY UNIX-DIRS TYPE PROGRAMS WITH THIS, as this does not
\\\ check for .. in the path. Pester me and ill implement this for
/\/ the next version.
\\\ o Be sure to set your nick below
(*/
options results
"GETMYNICK"
mynick=result
if ~show('L','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30,0) then do
'echo You need rexxsupport.library version 30 or greater in libs:'
exit 10
end
parse arg ':'prefix' 'type' 'channel' :'text
parse var prefix nick'!'useraddr
div='01'x
parse upper var text (div) pref cmd args (div)
args=strip(args)
if pref~='FDCC' then exit
text=getclip('gv.fdcc')
if text~='' then do
if (word(text,1)=nick)&(((time(S))-word(text,2))<=5) then do
call setclip('gv.fdcc',nick' 'time(S))
exit
end
end
call setclip('gv.fdcc',nick' 'time(S))
curdir=getclip('fdcc.'nick)
if (strip(curdir)='')|(index(curdir,'//')>0)|(left(curdir,5)~='FDCC:') then curdir='FDCC:'
select
when cmd='LIST' then do
if showlist('A','FDCC') then do
files=showdir(curdir)
c=0
'RAW NOTICE' nick ':Files in 'curdir
do until files=""
c=c+1
parse var files file' 'files
info=statef(curdir||file)
parse var info type' 'length' 'blocks' 'protection' 'days' 'minutes' 'ticks' 'comment
file=left(file,20,' ')
length=left(length,7,' ')
comment=left(comment,40,' ')
if type='FILE' then 'RAW NOTICE' nick ':' file length comment
else 'RAW NOTICE' nick ':' file 'DIR'
if c//5=0 then call delay(400)
end
'RAW NOTICE' nick ':End of list.'
end
else 'RAW NOTICE' nick ':Sorry, no FDCC directory was found on this client.'
end
when (cmd='SEND')|(cmd='MOVE') then do
if showlist('A','FDCC') then do
if (index(args,':')=0)&(index(args,'/')=0) then do
if exists(curdir||args) then do
'SAY /dcc' cmd nick curdir||args
end
else 'RAW NOTICE' nick ':' args 'not found.'
end
else 'RAW NOTICE' nick ':: and / are not allowable filename characters.'
end
else 'RAW NOTICE' nick ':Sorry, no FDCC directory was found on this client.'
end
when cmd='CD' then do
if showlist('A','FDCC') then do
if strip(args)~='' then do
if index(args,':')=0 then do
if exists(curdir||args) then do
if word(statef(curdir||args),1)='DIR' then do
select
when right(args,1)='/' then do
if right(curdir,1)='/' then do
if index(curdir,'/')=length(curdir) then do
curdir='FDCC:'
end
else do
curdir=reverse(curdir)
parse var curdir '/'.'/'curdir
curdir=reverse(curdir)||'/'
end
call setclip('fdcc.'nick,curdir)
'RAW NOTICE' nick ':Directory changed to 'curdir
end
else 'RAW NOTICE' nick ':You are in the root dir.'
end
when index(args,':')>0 then do
call setclip('fdcc.'nick,'FDCC:')
'RAW NOTICE' nick ':Directory changed to FDCC:'
end
otherwise do
cddir=curdir||args'/'
call setclip('fdcc.'nick,cddir)
'RAW NOTICE' nick ':Directory changed to 'curdir||args'/'
end
end
end
else 'RAW NOTICE' nick ':You cant CD to a file.'
end
else 'RAW NOTICE' nick ':' args 'does not exist.'
end
else 'RAW NOTICE' nick ':Cannot change to another drive ('args').'
end
else 'RAW NOTICE' nick ':Current directory is' curdir
end
else 'RAW NOTICE' nick ':Sorry, no FDCC directory was found on this client.'
end
when cmd='HELP' then do
'RAW NOTICE' nick ':Kuang Eleven FDCC'
'RAW NOTICE' nick ':/ctcp' mynick 'FDCC LIST lists files in format <name> <size> <filenote>'
'RAW NOTICE' nick ':/ctcp' mynick 'FDCC SEND <file> sends <file> in current dir'
'RAW NOTICE' nick ':/ctcp' mynick 'FDCC MOVE <file> sends <file> in current dir by DCC MOVE'
'RAW NOTICE' nick ':/ctcp' mynick 'FDCC CD <dir> changes directory to <dir> for that user'
end
otherwise 'RAW NOTICE' nick ':Unknown command:' cmd
end
exit
syntax:
"ECHO" "P=K11XDCC" "Command on line" SIGL "returned" RC ":" errortext(rc) sourceline(SIGL)
exit